package com.java1412;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

/**
 * @author java1412
 * @since 2024-04-19 14:07:04
 */
@SpringBootApplication
@EnableEurekaClient     // 开启eureka客户端
@EnableDiscoveryClient  // 开启服务发现
@EnableFeignClients     // 开启feign客户端
public class ServiceFeignApplication {
    public static void main(String[] args) {
        SpringApplication.run(ServiceFeignApplication.class, args);
    }

//    @Bean
//    public IRule rule() {
//        // return new RoundRobinRule();// 默认的轮询
//        return new RandomRule();    // 随机的负载均衡机制
//    }
}
